// category.js
Page({
  data: {
    categories: [
      { name: "书籍", icon: "https://ts1.cn.mm.bing.net/th/id/R-C.a2423619a5d529dd5ff4feaef54caa1b?rik=gjEAh%2bTiuV1rfA&riu=http%3a%2f%2fimg95.699pic.com%2fphoto%2f50128%2f0550.jpg_wh860.jpg&ehk=sYTzjq5TMzo%2fMOOlopLjFaQiGaZl1DQrypnN1cpc%2bF8%3d&risl=&pid=ImgRaw&r=0" },
      { name: "文具", icon: "https://ts1.cn.mm.bing.net/th/id/R-C.a2423619a5d529dd5ff4feaef54caa1b?rik=gjEAh%2bTiuV1rfA&riu=http%3a%2f%2fimg95.699pic.com%2fphoto%2f50128%2f0550.jpg_wh860.jpg&ehk=sYTzjq5TMzo%2fMOOlopLjFaQiGaZl1DQrypnN1cpc%2bF8%3d&risl=&pid=ImgRaw&r=0" },
      // ... 其他分类及其对应的图标路径
    ]
  },
  onCategoryTap: function(e) {
    var index = e.currentTarget.dataset.index;
    var category = this.data.categories[index];
    console.log('Selected category:', category);
    // 这里可以添加跳转或处理逻辑
  }
});
